module.exports = {
  entry: {
    main: './main.js'
  },
  module: {
    rules: [
      {
        test: /\.js$/, use: {
          loader: 'babel-loader',
          options: {
            presets: ['@babel/preset-env'],
            plugins: [[
              "@babel/plugin-transform-react-jsx",
              { pragma: "ToyReact.createElement" } // 这里如果不配置，默认为React.creatElement
            ]]
          }
        }
      }
    ]
  },
  mode: 'development',
  optimization: {
    minimize: false
  },
  devServer: {
    open: true
  }
}